﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 只读结构
{
    public readonly  struct Dimensions
    {
        public double Length { get; }
        public double Width { get; }
        public Dimensions(double length, double width) //结构的构造函数
        { 
            Length = length;
            Width = width;
        }
        public double Diagonal=>Math.Sqrt(Length*Length+Width*Width);
    }
}
